#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main()
{
	/*int ar[] = { 1,2,3,4,5,6,7,8,9,10 };
	int n = sizeof(ar) / sizeof(int);

	vector<int> V(ar, ar + n);*/
    int arr[] = { 2,2,2,3};
    vector<int> nums(arr, arr + sizeof(arr) / sizeof(int));

    int ans = 0;
    for (int i = 0; i < 32; ++i)
    {
        int total = 0;
        for (auto num : nums)
        {
            total += ((num >> i) & 1);
        }
        if (total % 3)
        {
            ans |= (1 << i);
        }
    }

    /*int tmp = 0;
    for (auto e : nums)
    {
        tmp ^= e;
    }
    cout << tmp << endl;

    int mask = tmp & (-tmp);

    int a = 0;
    int b = 0;
    for (auto e : nums)
    {
        if (e & mask)
        {
            a ^= e;
        }
        else
        {
            b ^= e;
        }
    }
    cout << a << " " << b;*/
    

    /*if (nums.size() > 1)
    {
        for (int i = 0;; i = 0)
        {
            if (nums[i] == nums[i + 1])
            {
                auto new_end = nums.erase(remove(nums.begin(), nums.end(), nums[i]), nums.end());
            }
            else
                break;
        }
        if (nums.size() > 2)
        {
            if (nums[1] == nums[2])
            {
                auto new_end = nums.erase(remove(nums.begin(), nums.end(), nums[1]), nums.end());
            }
        }
    }*/

	return 0;
}